package br.com.actionsystem.gdp.telas;

import br.com.actionsystem.gdp.modelo.Atividade;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

public class AbstratcTelas extends JInternalFrame {
	private JPanel cabecalhoPn = null;
	private JPanel corpoPn = null;
	private JPanel botaoPn = null;
	private JButton salvarBt = null;
	private JButton novoBt = null;
	private JButton excluir = null;
	public Font fontBond = new Font("verdana", Font.BOLD, 12);
       

	public AbstratcTelas(String titulo) {
		super(titulo,false,true,false,true);
		try {
			UIManager.setLookAndFeel("com.jtattoo.plaf.mcwin.McWinLookAndFeel");
		} catch (Exception e) {
			e.printStackTrace();
		}
        setDefaultCloseOperation(JInternalFrame.HIDE_ON_CLOSE);
		SwingUtilities.updateComponentTreeUI(this);
                setResizable(false);
                setLocation(50, 50);
	}

	public JPanel getCabecalhoPn() {
		if (cabecalhoPn == null) {
			cabecalhoPn = new JPanel();
			cabecalhoPn.setBackground(new Color(220, 230, 255));
			cabecalhoPn.setLayout(new GridBagLayout());
			cabecalhoPn.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
		}
		return cabecalhoPn;
	}

	public JPanel getCorpoPn() {
		if (corpoPn == null) {
			corpoPn = new JPanel();
		}
		return corpoPn;
	}

	public JPanel getBotaoPn() {
		if (botaoPn == null) {
			botaoPn = new JPanel();
			botaoPn.setBackground(new Color(220, 230, 255));
			GridBagConstraints cons = new GridBagConstraints();
			cons.insets = new Insets(0, 4, 0, 4);
			botaoPn.setLayout(new GridBagLayout());
			botaoPn.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 5));
			botaoPn.add(getSalvarBt(), cons);
			botaoPn.add(getNovoBt(), cons);
			botaoPn.add(getExcluir(), cons);
			Dimension dim = new Dimension(85, 27);
			for (int i = 0; i < botaoPn.getComponentCount(); i++) {
				botaoPn.getComponent(i).setFont(fontBond);
				botaoPn.getComponent(i).setMinimumSize(dim);
				botaoPn.getComponent(i).setPreferredSize(dim);
			}
		}
		return botaoPn;
	}

	public JButton getSalvarBt() {
		if (salvarBt == null) {
			salvarBt = new JButton("Salvar");
                        	}
		return salvarBt;
	}

	public JButton getNovoBt() {
		if (novoBt == null) {
			novoBt = new JButton("Novo");
		}
		return novoBt;
	}

	public JButton getExcluir() {
		if (excluir == null) {
			excluir = new JButton("Excluir");
		}
		return excluir;
	}

}
